<!DOCTYPE html>
<html>
<head>
<title>Fiche produit</title>
<meta name="viewport" charset="utf-8"
	content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- My style -->
<link href="../css/bootstrap.css" rel="stylesheet" media="screen">
<link href="../css/alert.css" rel="stylesheet">
<link href="../css/notification.css" rel="stylesheet">
<link href="../css/ecran-marketing.css" rel="stylesheet">

<link rel="stylesheet"
	href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script type="text/javascript">
function mettreDeCote(){
	alert("Zodio, vous reserve le produit pour une durée de 24 heures.");
}
function avertissement(){
	alert("Un sms vous sera envoyé dès la disponilitée de se produit.");
}
</script>
</head>
<body>
	<div class="container">
		<div class="row">
			<br />
			<div
				class="col-xs-6 col-xs-offset-3 col-sm-6 col-md-3 col-lg-offset-4">
				<img class="img-responsive" src="../img/zodio.gif"
					style="border-radius: 8px;">
			</div>

			<br /> <br /> <br /> <br /> <br />
			<?php
			require_once ("../services/ResponsableService.php");
			
			$responsableService = new ResponsableService ();
			$nom_article = $_GET ["nom_article"];
			$_SESSION ['article'] = $responsableService->getArticleByName ( $nom_article );
			$article = $_SESSION ['article'];
			
			echo '<div class="col-xs-6 col-xs-offset-2 column productbox"';
			echo '		style="background-color: #F1F1F1; margin-left: 80px;">';
			echo '		<a class="thumbnail" href="#"> <img class="img-responsive"';
			echo '				src="../img/' . $article->getNumArticle () . '.jpg"></a>';
			echo '				<div class="producttitle">' . $article->getLibelle () . '</div>';
			echo '			<div class="productprice">';
			echo '				<div class="pricetext" style="color: #088A4B">' . $article->getPrixUnitaire () . ' &euro;</div>';
			echo '			</div>';
			echo '			<div class="productprice">';
			echo '				<div class="producttitle">';
			echo '				Statut : ';
			if ($article->getQuantite () == "0") {
				echo '              <span class="text-danger"><strong>Rupture</strong>';
			} else {
				echo ' 				<span class="text-success"><strong>En stock</strong> ';
			}
			echo '				</div>';
			echo '			</div>';
			echo '</div>';
			
			if ($article->getQuantite () == "0") {
				echo '<center>';
				echo '<button type="submit" class="btn btn-warning" onClick="avertissement()">M\'avertir de la disponibilitée</button>';
				echo '</center>';
			} else {
				echo '<center>';
				echo '<button type="submit" class="btn btn-success" onClick="mettreDeCote()">Mettre de coté</button>';
				echo '</center>';
			}
			?>

			</div>
		<br />
		<br />
		<center>
			<?php
			$referer = isset ( $_SERVER ['HTTP_REFERER'] ) ? $_SERVER ['HTTP_REFERER'] : 'index.php';
			echo '	<div >';
			echo '			<a href="' . $referer . '"';
			echo '			class="btn btn-default panel-footer text-center" role="button"><span';
			echo '			class="glyphicon glyphicon-chevron-left"></span> Précédent</a>';
			echo '	</div>';
			?>
		</center>
	</div>

</body>
<footer>
	<script src="../js/bootstrap.js"></script>
</footer>
</html>